<template>
	<div class="singlepage">
		 <header class="classification_t header_fixed" id="title">
      <div class="classification_t_l" @click="goPrev">
            <img src="./../../assets/images/return.png" width="30%">
      </div>
      <div class="classification_t_r">{{$route.meta.title}}</div>
    </header>
    <div class="joinus_textarea_box">
        <textarea name="" id="" placeholder="请输入您的评价内容" v-model="param.content"></textarea>
    </div>
    <button class="recharge_btn" @click="pushComment">评价</button>
  </div>
</template>
<script>
import { evelate } from '@/api/allapis'
export default{
  name: 'Evelate',
  data: function() {
    return {
      param:{
        id:'',//评价订单id
        content:''//评价内容
      }
    }
  },
  methods:{
    goPrev(){
      this.$router.go(-1)
    },
    //提交评论
    pushComment(){
      const self = this
      evelate(this.param).then(response=>{
        self.$vux.toast.show({
          text: response.msg,
          type: 'success',
          time: 800,
          onHide: function () {
            self.$router.replace({
              name:'Orders'
            })
          }
        })
        // this.$router.go(-1)
      })
    },
  },
  created(){
    this.param.id = this.$route.params.id//获取订单id
  }
}
</script>
<style scoped>
.singlepage{padding-top:50px;}
.feedback_box{
  width:95%;margin:0 auto;border:1px solid #ddd;margin-top:10px;margin-bottom:10px;
}
.feedback_box input::placeholder{color: #666}
.feedback_box_phone{
  width:95%;margin:0 auto;border:1px solid #ddd
}
.feedback_box_phone input::placeholder{color: #666}
</style>



